package com.autotest.glin.functions;

import com.autotest.glin.util.IdNoUtil;
import com.autotest.glin.util.RegisterLocationUtil;

/*
 *生成18位身份证号码函数
 */
public class IdNoFunction implements Function {
    @Override
    public String excute(String[] args) {
        StringBuffer strBuffer = new StringBuffer();
        strBuffer.append(IdNoUtil.randomLocationCode(RegisterLocationUtil.registerLocation()));
        strBuffer.append(IdNoUtil.randomBirthday());
        strBuffer.append(IdNoUtil.randomCode());
        String eighteenth = IdNoUtil.verificationCode(strBuffer.toString());
        strBuffer.append(eighteenth);
        return strBuffer.toString();   //返回18位身份证号
    }

    @Override
    public String getReferenceKey() {
        return "idno";
    }
}
